/************************************************************************
*
*    File Name: enemyplane.cpp
*    Description: 编写敌机类，加载敌机图片，连接敌机自动移动定时器
*    Version: V2.0
*    Author: 王涵
*    Create Time: 2024-11-27
*
*************************************************************************/
#include "enemyplane.h"

EnemyPlane::EnemyPlane(QObject *parent) : QObject(parent) ,QGraphicsPixmapItem ()
  ,speed(ENEMY_SPEED)
{
    QPixmap enemy_picture;
    enemy_picture.load(ENEMY_PATH);

    setPixmap(enemy_picture.scaled(ENEMY_WIDTH,ENEMY_HEIGHT));

    QTimer *timer1 = new QTimer(this);
    connect(timer1,&QTimer::timeout,this,&EnemyPlane::enemy_plane_move);
    timer1->start(32);
}

